import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import LoginView from "@/views/LoginView";
import TodoListView from "@/views/TodoListView";
import RegistryView from "@/views/RegistryView";

import UploadView from "@/views/UploadView";
import ChangeView from "@/views/ChangeView";

import BarView from "@/views/Charts/BarView";
import LineView from "@/views/Charts/LineView";
import RingView from "@/views/Charts/RingView";
import FunnelView from "@/views/Charts/FunnelView";
import WaterfallView from "@/views/Charts/WaterfallView";


import BlogView from "@/views/BlogView";
import RepositoryView from "@/views/RepositoryView";
import ListView from "@/views/ListView";
import NotFind from "@/views/NotFind";

Vue.use(VueRouter)

const routes = [
  {
    path: '/h',
    name: 'home',
    component: HomeView
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '@/views/AboutView.vue')
  },
  //  添加一个新的路由规则， 使用一个新的组件
  {
    path: '/',
    name: 'LoginView',
    component: LoginView
  },
  {
    path: '/registry',
    name: 'RegistryView',
    component: RegistryView
  },

  {
    path: '/todolist',
    name: 'TodoListView',
    component: TodoListView,
    children: [
      {
        path: '/list',
        name: 'List',
        component:ListView
      },
      {
        path: '/upload',
        name: 'upload',
        component:UploadView
      },//___________________________________________________________________
      {
        path: '/change',
        name: 'ChangeView',
        component: ChangeView
      },//___________________________________________________________________
      
      
      {
        path: '/bar',
        name: 'BarView',
        component: BarView
      },//___________________________________________________________________
      {
        path: '/line',
        name: 'LineView',
        component: LineView
      },//___________________________________________________________________
      {
        path: '/ring',
        name: 'RingView',
        component: RingView
      },//___________________________________________________________________
      {
        path: '/funnel',
        name: 'FunnelView',
        component: FunnelView
      },//___________________________________________________________________
      {
        path: '/waterfall',
        name: 'WaterfallView',
        component: WaterfallView
      },//___________________________________________________________________



      {
        path: '/blog',
        name: 'BlogView',
        component: BlogView
      },//___________________________________________________________________
      {
        path: '/repository',
        name: 'RepositoryView',
        component: RepositoryView
      },
    ]
  },
  {
    path: '/404',
    component:NotFind,
    hidden: true
  },
    // 404 page must be placed at the end !!!
    { path: '*', redirect: '/404', hidden: true }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
